<#assign tit>定金合同选择</#assign>
<@page.html title=tit>
<script type="text/javascript">
  function selOk() {
    var i, vv = null;
    var cbs = document.getElementsByName("sel");
    if(!cbs || cbs.length==0) {
      window.alert("没有可选定金");
      return false;
    }
    for(i=0; i<cbs.length; i++) {
      if(cbs[i].checked) {
        vv = cbs[i].value+","+cbs[i].getAttribute("mm");
        break;
      }
    }
    if(!vv) {
      window.alert("请选择定金");
      return false;
    }

    if(window.parent && window.parent.seldjOk)
      window.parent.seldjOk(vv);
    cancel();
  }
  function cancel() {
    if(window.parent && window.parent.closeWin)
      window.parent.closeWin();
    else
      window.close();
  }
  function trsel(tr) {
    tr.cells[0].firstChild.checked = true;
  }
</script>
<div style="">

  <div>
    <table class="list">
      <tr>
        <th width="6%">选择</th>
        <th width="10%">定金编号</th>
        <th width="12%">姓名</th>
        <th width="20%">证件号码</th>
        <th width="12%">手机</th>
        <th width="10%">金额</th>
        <th width="15%">会员编号</th>
      </tr>
      <#if list??><#list list as c>
      <tr<#if c_index%2==1> class="line2"<#else> class="line1"</#if> onclick="trsel(this);">
        <td class="no"><input type="radio" name="sel" value="${c.saleId!}" mm="${c.earnestAmount?string("0.00")}" /></td>
        <td>${c.saleId!}</td>
        <td class="member"><a href="javascript:mbinfo('${c.memberCode!}');">${c.custName!}</a></td>
        <td>${c.idNumber!}</td>
        <td>${c.mobile!}</td>
        <td class="money">${c.earnestAmount?string("0.00")}</td>
        <td>${c.memberCode!}</td>
      </tr></#list></#if>
    </table>
  </div>
  <div class="button"><input type="button" value="确定" onclick="selOk();"><input type="button" value="取消" onclick="cancel();"></div>
</div>
</@page.html>